package cn.hua.trip.app.base.controller;

import cn.hua.trip.base.query.StrategyQueryObject;
import cn.hua.trip.base.query.TravelCommendQueryObject;
import cn.hua.trip.base.service.IStrategyService;
import cn.hua.trip.base.service.ITravelCommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("strategies")
public class StrategyController {

    @Autowired
    private IStrategyService strategyService;

    @Autowired
    private ITravelCommendService  travelCommendService;

    @GetMapping("/travelCommends")
    public Object selectTravelCommendByState(TravelCommendQueryObject qo){
        return travelCommendService.selectTravelCommendByState(qo);
    }


    /*全部的大攻略*/
    @GetMapping
    public Object list(StrategyQueryObject qo){
        return strategyService.list(qo);
    }


    /*获取大攻略*/
    @GetMapping("/{id}")
    public Object get(@PathVariable Long id){
        return strategyService.get(id);
    }
}
